<script>
	export default {
		onLaunch: function() {
			wx.checkSession({
				success: () => {
					// 登录还在有效期内
					const token = wx.getStorageSync('token');
					if (!token){
						wx.navigateTo({
							url: 'pages/login/login'
						});
					}
				},
				fail: () => {
					// 登录过期了
					wx.removeStorageSync('token');
					wx.navigateTo({
						url: 'pages/login/login'
					});
				}
			})
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
